import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 客户分配
 */
@Entity('customer_assign')
export class CustomerAssignEntity extends BaseEntity {
  @Index()
  @Column({ comment: '客户ID' })
  customerId: number;

  @Column({ comment: '分配时间', type: 'varchar' })
  assignTime: Date;

  @Column({ comment: '备注', nullable: true, type: 'text' })
  remark: string;

  @Column({ comment: '分配原因', dict: ['离职', '区域调整'], default: 0 })
  reason: number;

  @Index()
  @Column({ comment: '原负责人', nullable: true })
  oldUserId: number;

  @Index()
  @Column({ comment: '新负责人', nullable: true })
  newUserId: number;
}
